<?php defined("MAIN_DIR") or die("No direct access");

require_once ADMIN.HEADFILE;
?>
<script type="text/javascript">
page = "bank";
func = add_bank;
</script>
<div align="left">
<h1>Список банков</h1><?php
$banks_query = "select `B`.`bank_id`,`B`.`link`,`B`.`name`,`B`.`parent`,`C`.`path` from `bank` as `B`,`city` as `C` where `B`.`city_id` = '$_SESSION[city_admin]' and `B`.`city_id` = `C`.`city_id` order by `name`";
$banks_result = mysql_query($banks_query);
?>
<input type='text' id='search' />
<table cellpadding="5" cellspacing="0" class='light'>
	<tr id='header'>
		<td width="30px" style="border-bottom:1px gray solid">ID</td>
		<td width="300px" style="border-bottom:1px gray solid">Название</td>
		<td width="70px" style="border-bottom:1px gray solid">Значимость</td>
		<td width="200px" style="border-bottom:1px gray solid">Действия</td>
	</tr><?php
	while ($bank_row = mysql_fetch_array($banks_result))
	{
		?><tr>
			<td><?php echo $bank_row['bank_id']?></td>
			<td><a href='<?php echo "/$bank_row[path]/banks/".$bank_row['link'].".html"; ?>'><?php echo $bank_row['name']?></td>
			<td><?php echo $bank_row['parent'] ? "Филиал" : "Гол. офис"; ?></td>
			<td>
				<a href='/admin/banks/edit/<?php echo $bank_row['bank_id']?>'>Редактировать</a> |
				<a onclick='return confirm_del()' href='/admin/banks/delete/<?php echo $bank_row['bank_id']?>'>Удалить</a>
			</td>
		</tr><?php
	}
?></table>
<br /><a href='/admin/banks/add'>Добавить</a><br />
</div>
<div style='height:30px'>&nbsp;</div>

<?php require_once ADMIN.FOOTERFILE; ?>